<?php

declare(strict_types=1);

namespace Monarch\View;

use Monarch\HTTP\Request;

interface RendererInterface
{
    /**
     * Generates the output for the given route file.
     * At this point, the control file has already been loaded and executed,
     * and the results of the control can be set with the `withRouteParams` method.
     */
    public function render(string $routeFile): ?string;

    /**
     * Sets the content and data to be used when rendering the view.
     * This is generated by the control file, if one exists.
     */
    public function withRouteParams(string $content, array $data = []): self;

    /**
     * Sets the Request object to be used when rendering the view.
     */
    public function withRequest(Request $request): self;
}
